package org.csmzxy.class2334;
class Animal1{
    public void speak(){
        System.out.println("动物发出叫声");
    }
}
class Cat1 extends Animal{
    @Override
    public void speak() {
        System.out.println("小猫：喵喵……");
    }
}
class Dog1 extends Animal{
    @Override
    public void speak() {
        System.out.println("小狗：汪汪……");
    }
    public void houseKeep(){
    System.out.println("狗狗会看家");
    }
}
public class Example14 {
    public static void main(String[] args){
        Animal animal = new Dog1();
        animal.speak();
        Dog1 dog = (Dog1) animal;
        dog.houseKeep();
    }
}
